UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+O2uL/P3WJXKifBAMbZQSBKOKWNd/fRjjOeMY4oBM9s=' 
WHERE 
  key_id = '2a14c21d75212c2ce1718cf2eb4c00a7f6f575d16079bddf870c5ad8800f772b' 
  AND (
    token = '+O2uL/P3WJXKifBAMbZQSBKOKWNd/fRjjOeMY4oBM9s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026