UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cFMpQN3Zy6ozDz8JrVe3cwG8fQsAMZ/hitL9Sl6O9u4=' 
WHERE 
  key_id = '7efe0f4285a41f1c8019e65e929e94cf99e12644d95fd0407ae320b86098e370' 
  AND (
    token = 'cFMpQN3Zy6ozDz8JrVe3cwG8fQsAMZ/hitL9Sl6O9u4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036