UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oVOd59sTWR7KBP3OEpXXblen3f2C+aR222CL+Cz9P18='
WHERE
key_id = 'fcecfeffc03c7168893a4030d38481c3ec93013e73d79ff5f3f501f9953ec791'
AND (
token = 'oVOd59sTWR7KBP3OEpXXblen3f2C+aR222CL+Cz9P18='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)