UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Rle8c6pjs/w/Ts6ZC8UiKil52eK6ZxL0knCTK1ISDO8='
WHERE
key_id = 'f524b9fa20e863e85d83d033548337810dc0f601f4dd8a6f9d57a5d68361839a'
AND (
token = 'Rle8c6pjs/w/Ts6ZC8UiKil52eK6ZxL0knCTK1ISDO8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)