UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JR4zal/Ag/QEOsccpvGrAAtnGX/ke8XTeFmZXbz3vks='
WHERE
key_id = 'cfa1fa5743f7108ef02b1d19ee8c22014b96811da471e1d446491f8cc31953d7'
AND (
token = 'JR4zal/Ag/QEOsccpvGrAAtnGX/ke8XTeFmZXbz3vks='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)