UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tZE/24qGzFG7WaW6TJ0CWhre1h3ELBdVv6gY3+QZvfE='
WHERE
key_id = 'ed4ebc134462e50b25636f846c5040b8145b9f78827d85ae07e3c5e51d3da4ae'
AND (
token = 'tZE/24qGzFG7WaW6TJ0CWhre1h3ELBdVv6gY3+QZvfE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)