UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'in8SpS4HRc1+BzbFudc5M9Tg8tdkG6Bx0fCw/X69qw4=' 
WHERE 
  key_id = '26b16dc95ef50266f47debb7626e121b78362b225a35c56bdcae08a6076cfd8d' 
  AND (
    token = 'in8SpS4HRc1+BzbFudc5M9Tg8tdkG6Bx0fCw/X69qw4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046