UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't/7alH+cTKWTOD17TXOA1uPZ45sPmQLK0wWkfgQ9mGU='
WHERE
key_id = 'c5da387939638bfb469d55231d197dc29dbd7db03540ff27ce297f2037d07b81'
AND (
token = 't/7alH+cTKWTOD17TXOA1uPZ45sPmQLK0wWkfgQ9mGU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)