UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3aNGqFpY+FOfXb3yxwMaWQRsV/TrXA5RnnUZ5+Vr3xA='
WHERE
key_id = 'cadda8e386859490672dfff03f7e55ab93eab02cadbbb4e8e0a2a2fca208b3c5'
AND (
token = '3aNGqFpY+FOfXb3yxwMaWQRsV/TrXA5RnnUZ5+Vr3xA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)