UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OgwmjPP7jUbZMS1HsJuF62a7+l3F879yaC5lcgYRcjw='
WHERE
key_id = '01cd55e07fc75827cb7e6f91f4e05736defd56931792faa86aa2618a50e4d102'
AND (
token = 'OgwmjPP7jUbZMS1HsJuF62a7+l3F879yaC5lcgYRcjw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)