UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'blPKpttNwIsLZVYhAVsL9ZpF9W0aP7Q7qQym8ReEOos=' 
WHERE 
  key_id = '6b81cc7d3eabb073849b8073f6d9c0849a62e5dfce7ba4ad9d7c22c522365236' 
  AND (
    token = 'blPKpttNwIsLZVYhAVsL9ZpF9W0aP7Q7qQym8ReEOos=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029