UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bHn4LiaSHxcSpsmFikSbOd8rAPB8MYGeu0bhZKeGypQ=' 
WHERE 
  key_id = '178e371bb32c157ceb9d624e8780ce813ff3fd5be40595d894b9e26e6dc42b11' 
  AND (
    token = 'bHn4LiaSHxcSpsmFikSbOd8rAPB8MYGeu0bhZKeGypQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031