UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RCwYVHoPws4Bg4EPYBMEbBmjeyupF4WaE3WgumWXmxg=' 
WHERE 
  key_id = 'f6623e192528b83f37e9cd3b5057c6c1e115c6a563d38923a9b6ee079d0360ba' 
  AND (
    token = 'RCwYVHoPws4Bg4EPYBMEbBmjeyupF4WaE3WgumWXmxg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055