UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G2VSxn4tFAnk4cvaTUYtbrMG838FZLMHzX30/8k0f6g=' 
WHERE 
  key_id = '8c50949eef6aed39174799a1c1f3b319695b6d25fbdecb4938b971dd074bcd13' 
  AND (
    token = 'G2VSxn4tFAnk4cvaTUYtbrMG838FZLMHzX30/8k0f6g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030