UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w8ubDb9tmqVTiqt2/BHj4ffBD+pMJuFLfvfqqamFk+Y='
WHERE
key_id = 'cab40e102c309cf1a18dae1f60fbc9240dd938be6057d60b38852ee7ea42eb2e'
AND (
token = 'w8ubDb9tmqVTiqt2/BHj4ffBD+pMJuFLfvfqqamFk+Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)