UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Dx8B7daF9WsXgaPdBFrZDbpLy0I+14HN7DlqrCkYz9o=' 
WHERE 
  key_id = '3d47255a0c698bd9aa08c61f0766b83233ac58aac9ad64d305923f365ba92a5c' 
  AND (
    token = 'Dx8B7daF9WsXgaPdBFrZDbpLy0I+14HN7DlqrCkYz9o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022