UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DaecJZZytVjtQnvjF0+qklfRFP61Smi036M1VRcCvHQ=' 
WHERE 
  key_id = '19a1ddd5e2e2e7265ca802f6d1d9394ecb3a34ade334e24ac23d0c9d5a21f54b' 
  AND (
    token = 'DaecJZZytVjtQnvjF0+qklfRFP61Smi036M1VRcCvHQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032