UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ESpyhKM/zzK/KHm91KQtMxZCXuHrtLoQRYm2Q6Ns3Po=' 
WHERE 
  key_id = '775f5d0b94fbf7439d22e604f128f2301006e20456afda967e1553028a4ad3ab' 
  AND (
    token = 'ESpyhKM/zzK/KHm91KQtMxZCXuHrtLoQRYm2Q6Ns3Po=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026