UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7l2efAFuk0JkjQjO2a2HC5kSyU9t3xDEyKgfPqZL9jQ='
WHERE
key_id = 'd3c2c93880c7f348ffa55ea788ff7b478fc689ceddcfcb736c02e21b02e42fd2'
AND (
token = '7l2efAFuk0JkjQjO2a2HC5kSyU9t3xDEyKgfPqZL9jQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)