UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aR7v6LSry2mlLkCTaMaia8njEkXYD7mgUNMGGnI2/EA='
WHERE
key_id = 'e2f689d28aca0de9cc92a291718347151214d25cbf177cb582d7889f12019822'
AND (
token = 'aR7v6LSry2mlLkCTaMaia8njEkXYD7mgUNMGGnI2/EA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)