UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qKOP2Mr6lv/Z2TQFfVBlXP+cRFzURyPSdwe+seY4DXk='
WHERE
key_id = 'a6c48f668f235f131af5cd995a0eb1d699cb578adcb0dad391fca9ec8d2f1c99'
AND (
token = 'qKOP2Mr6lv/Z2TQFfVBlXP+cRFzURyPSdwe+seY4DXk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)