UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7kOkjgyvX5/OpGGmuMbKTyhyl46ZXOKD3OCG8NFbhDU=' 
WHERE 
  key_id = '4bfe41d071cfde8cb1d0088e8d3c77be7ac703076dbf2904bdcca80b796045df' 
  AND (
    token = '7kOkjgyvX5/OpGGmuMbKTyhyl46ZXOKD3OCG8NFbhDU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034