UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W7X9zYOdodM+udByWKDqJUPNBxvJiR25WcXn96f4bwo='
WHERE
key_id = 'd853e2373005803c1edab0c4ce013295e5da0006b3e5ef0696ef636579be5ec6'
AND (
token = 'W7X9zYOdodM+udByWKDqJUPNBxvJiR25WcXn96f4bwo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)