UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wzOawidXPoaVKMFSaimAYjjdIlN6z0v/++WXMI55kec=' 
WHERE 
  key_id = '8985a7480ff04f40f09f9f85b0205a34ff6bf57a617d0d00d1063c8621b2dacc' 
  AND (
    token = 'wzOawidXPoaVKMFSaimAYjjdIlN6z0v/++WXMI55kec=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036