UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zdpRrHvfvDFOynTxiRxNW4JY2M44V5DywysC5+CNK4I='
WHERE
key_id = '5175a63f60d54fe6fc9ceaa37a1097f541e017734607451286a0c95846a0d2f0'
AND (
token = 'zdpRrHvfvDFOynTxiRxNW4JY2M44V5DywysC5+CNK4I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)