UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v+M/XBIid5rir7e8jcUfM73lbxah600L+vEC0wAox5k=' 
WHERE 
  key_id = '3758ebedbd8edfb1752bedebe3758c662b60ecdf2ce04f4f7991e1cafed6314a' 
  AND (
    token = 'v+M/XBIid5rir7e8jcUfM73lbxah600L+vEC0wAox5k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045