UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dCdGT05ArhfJPbsqTjTnxjDshWEh5fd8HyIb5Zomovc='
WHERE
key_id = '56c52e492a9a32a547b1e044848bfb04465e528b3e6d461dbf13e5aae92a7d34'
AND (
token = 'dCdGT05ArhfJPbsqTjTnxjDshWEh5fd8HyIb5Zomovc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)