UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IRNCkseTxt6sgzOv5utQwpDbd5nDaTFtcb68PuKU+kU=' 
WHERE 
  key_id = 'b68b2d6df0f8b565d04c2c691d59308369d139d9a7ec58d6f1eac1b484438139' 
  AND (
    token = 'IRNCkseTxt6sgzOv5utQwpDbd5nDaTFtcb68PuKU+kU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00083