UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ge+/eE1eimCJiAqC8c8G+tvGoGwbTyNi/wTLWZIzVr4=' 
WHERE 
  key_id = 'acfd7a526af95d446f0565e269bf80bf58be136ebd467d732a8f62c3f1b088b7' 
  AND (
    token = 'Ge+/eE1eimCJiAqC8c8G+tvGoGwbTyNi/wTLWZIzVr4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032