UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WOtfklYut9hX1DkC6vwfWa3t4+CG2BmIIyNJrIN/uLc='
WHERE
key_id = '899371b4c7fb74d4a340d3c1c06e1d61e7953062ac963e395c382bd28ae6df20'
AND (
token = 'WOtfklYut9hX1DkC6vwfWa3t4+CG2BmIIyNJrIN/uLc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)