UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0V0i9em3eRjUcKcpiB3/MA3ZNIxxgeKYDxnnwqj423A='
WHERE
key_id = 'cc96c5196d23478d7979fed1003055db1e65bc2e45d96739cd7d9b6fe3dcd7fc'
AND (
token = '0V0i9em3eRjUcKcpiB3/MA3ZNIxxgeKYDxnnwqj423A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)