UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bYrNAXUNwjhXpgC/VK59oh/5VFrXEIFYO8kBwnQCosE=' 
WHERE 
  key_id = '88e7af7bdb6f0f99149e76c89368418aa124fe27538f8e7ecbd17a2f00715ef6' 
  AND (
    token = 'bYrNAXUNwjhXpgC/VK59oh/5VFrXEIFYO8kBwnQCosE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046