UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pHTwa+aEJLwPaZ7jyZiuH8dUbNi8WT7Qq0l8WvYyiNA=' 
WHERE 
  key_id = '155b8ebe2cf0ac17e5df6afd54dd5f3101f5223b298c620295402c731a840d21' 
  AND (
    token = 'pHTwa+aEJLwPaZ7jyZiuH8dUbNi8WT7Qq0l8WvYyiNA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042