UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xt7qDj7r9hEo+3w7PT1SvdW0AXeNpRu3hd9/zNUZEqY=' 
WHERE 
  key_id = '98c9ed8058fdf3456e38f779c1fb8af766175702d2d9e48c171db6cdcd443d6d' 
  AND (
    token = 'xt7qDj7r9hEo+3w7PT1SvdW0AXeNpRu3hd9/zNUZEqY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034