UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DhwYUWGhi7Lc0TLrD5AYl4FlKg+2zm+9VFrM5lIBYek=' 
WHERE 
  key_id = 'b5a8ea4a73620e7a7d5ce7f458bd0c0ca5e451278d81c316bc48dac6e7d1ea22' 
  AND (
    token = 'DhwYUWGhi7Lc0TLrD5AYl4FlKg+2zm+9VFrM5lIBYek=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032